<?php
$cs = Yii::app()->clientScript;
$cs->registerScriptFile('http://maps.google.com/maps/api/js?sensor=false');
$address = str_replace('"',"'",trim($this->getCompanyAddressByLanguage()));
$company_name = str_replace('"',"'",trim($this->getSiteNameByLanguage()));
$company_info = $company_name.'<br />'.$address;
?>
<div id="map-container" style="width: 500px; height: 500px;"></div>
<script type="text/javascript">
var geocoder = new google.maps.Geocoder();
var map = null;
var marker = null;
var current_latlng = null;
var infowindow = null;

function init_map(latlng)
{
    if (latlng == undefined)
        latlng = new google.maps.LatLng(10.75918, 106.66249800000003);
    var mapOptions = {
        streetViewControl: false,
        zoom: 16,
        center: latlng,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    map = new google.maps.Map($('#map-container').get(0), mapOptions);
}

function add_marker(latlng)
{
    marker = new google.maps.Marker({
        map: map,
        position: latlng
    });
    google.maps.event.addListener(marker, 'click', function(){
        infowindow = new google.maps.InfoWindow();
        infowindow.setContent("<?php echo $company_info; ?>");
        infowindow.setPosition(latlng);
        infowindow.open(map);
    });
}
    var latlng = new google.maps.LatLng(10.855234,106.642929);
    init_map(latlng);
    add_marker(latlng);
</script>